package ${basePackage}.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import ${basePackage}.model.dao.${modelNameUpperCamel}Dao;
import ${basePackage}.model.example.${modelNameUpperCamel}Example;
import ${basePackage}.model.pojo.${modelNameUpperCamel};
import ${basePackage}.model.base.BaseServiceImpl;
import ${basePackage}.service.${modelNameUpperCamel}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by ${author} on ${date}.
 */
@Service
@Transactional
public class ${modelNameUpperCamel}ServiceImpl extends BaseServiceImpl<${modelNameUpperCamel},${modelNameUpperCamel}Dao> implements ${modelNameUpperCamel}Service {
    @Autowired
    private ${modelNameUpperCamel}Dao ${modelNameLowerCamel}Dao;

    @Override
    public ${modelNameUpperCamel}Dao getDao() {
        return ${modelNameLowerCamel}Dao;
    }

    @Override
    public PageInfo<${modelNameUpperCamel}> list(Integer page, Integer size) {
        PageHelper.startPage(page, size);
        ${modelNameUpperCamel}Example example = new ${modelNameUpperCamel}Example();
        example.createCriteria().andIsDelEqualTo(false);
        PageInfo pageInfo = new PageInfo(${modelNameLowerCamel}Dao.selectByExample(example));
        return pageInfo;
    }
}
